<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use HasFactory;

    protected $table = "user";

    protected $guarded = [];

    public function getUserInfo($mobile)
    {
        $stdData = array();
        $data = self::where('phone', $mobile)->first();

        if($data) $stdData = $data->toArray();
        return $stdData;
    }

    public function getUserInfoById($id)
    {
        $stdData = array();
        $data = self::where('id', $id)->first();
        if($data) $stdData = $data->toArray();

        return $stdData;
    }
}
